package com.bw.controller;

import cn.hutool.crypto.digest.DigestUtil;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.bw.domain.Section;
import com.bw.service.SectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

public class UploadDataListener implements ReadListener<Section> {

    private SectionService sectionService;

    public UploadDataListener(SectionService sectionService) {
        this.sectionService = sectionService;
    }
    public UploadDataListener(Object p0) {

    }

    @Override
    public void invoke(Section section, AnalysisContext analysisContext) {
        sectionService.insertUsers(section);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("--------解析完之后的方法----------");

    }
}

